<?
$polls = $this->polls;
?>
<div class="content-box">

    <div class="content-box-header">
        <h3>Polls</h3>
        <ul class="content-box-tabs">
            <li><a class="default-tab" href="#tab1">Table</a></li>
        </ul>
        <div class="clear"></div>
    </div>
    <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
            <a href="/admin/poll/add" class="btn">Add</a>
            <table class="table table-striped">
                <thead>
                <tr>
                    <td>Question</td>
                    <td>Created at</td>
                    <td>Updated at</td>
                    <td></td>
                    <td></td>
                </tr>
                </thead>

                <tbody>
                <? foreach ($polls as $poll): ?>
                <tr>

                    <td><?= $poll['name'] ?></td>
                    <td><?= $poll['createdAt']->format('Y-m-d') ?></td>
                    <td><?= $poll['updatedAt']->format('Y-m-d') ?></td>
                    <td><a href="/admin/poll/editing/id/<?= $poll['id'] ?>" class="btn">Edit</a></td>
                    <td><a href="/admin/poll/delete/id/<?= $poll['id'] ?>" class="btn btn-danger delete">Delete</a></td>
                </tr>
                    <? endforeach; ?>
                </tbody>
            </table>
        </div>
    </div>
</div>


